package com.sx.manage.controller.consumer.person;

import javax.annotation.Resource;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.sx.common.util.NumberUtil;
import com.sx.manage.biz.consumer.info.IMNetworkPersonConsumerBiz;
import com.sx.manage.controller.base.MBaseController;
import com.sx.manage.service.consumer.MConsumerBankWebServiceImpl;
import com.sx.manage.service.consumer.MConsumerWebServiceElecAccountImpl;
import com.sx.manage.service.consumer.MPersonConsumerInfoWebServiceImpl;
import com.sx.manage.servlet.ViewAndModel;
import com.sx.model.manage.mybatis.form.consumer.page.MConsumerPageForm;
import com.sx.model.manage.mybatis.vo.consumer.MConsumerBankMapVO;
import com.sx.model.manage.mybatis.vo.consumer.page.MConsumerPageVO;
import com.sx.model.manage.mybatis.vo.result.ResultBooleanVO;
import com.sx.model.manage.mybatis.vo.result.ResultListVO;

/**
 * 个人用户电子账号
 * 
 * @author zhenzhanlong
 *
 */
@Controller
@RequestMapping("/perElecAcc")
public class MPersonElecAccountController extends MBaseController {

	private Logger _log = LoggerFactory.getLogger(this.getClass());

	// 个人用户信息
	@Resource(name = "mNetworkPersonConsumerBizImpl")
	private IMNetworkPersonConsumerBiz mNetworkPersonConsumerBizImpl;

	@Resource(name = "personConsumerInfoWebServiceImpl")
	private MPersonConsumerInfoWebServiceImpl personConsumerInfoWebServiceImpl;
	// 用户银行信息
	@Resource(name = "consumerBankWebServiceImpl")
	private MConsumerBankWebServiceImpl consumerBankWebServiceImpl;
	//电子银行账号
	@Resource(name="consumerWebServiceElecAccountImpl")
	private MConsumerWebServiceElecAccountImpl consumerWebServiceElecAccountImpl;
	
	public IMNetworkPersonConsumerBiz getmNetworkPersonConsumerBizImpl() {
		return mNetworkPersonConsumerBizImpl;
	}

	public void setmNetworkPersonConsumerBizImpl(IMNetworkPersonConsumerBiz mNetworkPersonConsumerBizImpl) {
		this.mNetworkPersonConsumerBizImpl = mNetworkPersonConsumerBizImpl;
	}

	public MPersonConsumerInfoWebServiceImpl getPersonConsumerInfoWebServiceImpl() {
		return personConsumerInfoWebServiceImpl;
	}

	public void setPersonConsumerInfoWebServiceImpl(MPersonConsumerInfoWebServiceImpl personConsumerInfoWebServiceImpl) {
		this.personConsumerInfoWebServiceImpl = personConsumerInfoWebServiceImpl;
	}

	public MConsumerBankWebServiceImpl getConsumerBankWebServiceImpl() {
		return consumerBankWebServiceImpl;
	}

	public void setConsumerBankWebServiceImpl(MConsumerBankWebServiceImpl consumerBankWebServiceImpl) {
		this.consumerBankWebServiceImpl = consumerBankWebServiceImpl;
	}
	/**
	 * 跳转到 普通用户列表界面
	 */
	@RequestMapping(value = "individualConsumer")
	public ViewAndModel consumerview() {
		_log.debug(" MPersonConsumerInfoController   方法  consumerview  调用");
		ViewAndModel model = new ViewAndModel(request, cache);
		model.setViewName("consumer/personal/elec/individualConsumer");
		return model;
	}
	/** 获取用户分页信息 */
	@RequestMapping(value = "pageConsumer")
	@ResponseBody
	public ResultListVO<MConsumerPageVO> page(MConsumerPageForm form) {
		_log.debug(" MPersonConsumerInfoController   方法  page 调用");
		return mNetworkPersonConsumerBizImpl.get_consumer_elec_page(form);
	}
	
	/**
	 * 绑定出入金卡数据获取
	 * 
	 * @param consumer_id
	 * @param bank_map_id
	 * @return
	 */
	@RequestMapping(value = "bindBankCard/List")
	@ResponseBody
	public ResultListVO<MConsumerBankMapVO> bindBankCardList(Long consumer_id) {
		_log.debug("绑定出入金卡数据获取 调用");
		return consumerWebServiceElecAccountImpl.bindBankCardList(consumer_id);
	}
}
